package com.habitreformer.core.task;

import java.util.List;

import junit.framework.TestCase;

public class TaskFactoryTest extends TestCase
{
	TaskFactory taskFactory;

	public void setUp() throws Exception
	{
	}

	public void testGetInstance()
	{
		assertNull(taskFactory);
		taskFactory = TaskFactory.getInstance();
		assertNotNull(taskFactory);
		assertTrue(taskFactory instanceof TaskFactory);
	}

	@SuppressWarnings("unchecked")
	public void testGetTaskList()
	{
		taskFactory = TaskFactory.getInstance();
		List list = taskFactory.getTaskList();
		assertEquals(list.size(), TaskFactory.DEFAULT_TASK_NUMBER);
		for (int i = 0; i < list.size(); i++)
		{
			Object o = list.get(i);
			assertTrue(o instanceof Task);
		}

	}
}
